package com.example.demo.controller;

import com.example.demo.service.LoginService;
import com.example.demo.vo.Result;
import com.example.demo.vo.params.LoginParams;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class RegisterController {

    @Autowired
    private LoginService loginService;

    @PostMapping("/register")
    public Result register(@RequestBody LoginParams loginParams){
        // 后期将实现 sso 单点登录，即把登录和注册功能踢出去，提供独立的接口服务
        return loginService.register(loginParams);
    }
}
